//express_demo.js 文件
var express = require('express');
var app = express();
var classify = require("./classify")

app.get('/', function (req, res) {
    res.send('Hello World');
})

app.all('*', function (req, res, next) {
    console.log(req.method);
    res.header("Access-Control-Allow-Origin", "*");
    res.header('Access-Control-Allow-Headers', 'Content-type');
    res.header("Access-Control-Allow-Methods", "PUT,POST,GET,DELETE,OPTIONS,PATCH");
    next();
});

app.use("/classify", classify)

var server = app.listen(8081, function () {

    var host = server.address().address
    var port = server.address().port

    console.log("应用实例，访问地址为 http://%s:%s", host, port)

})